<nz-card>

  <button nz-button (click)="openEdit()" [nzType]="'primary'">新增</button>

  <nz-divider [nzDashed]=true  style="margin: 5px;"></nz-divider>

  <nz-table #expandTable [nzData]="listOfMapData" nzTableLayout="fixed" [nzLoading]="loading"
            [nzFrontPagination]="false" nzBordered nzSize="small">
    <thead>
    <tr>
      <th>菜单编号</th>
      <th>菜单名称</th>
      <th>图标</th>
      <th>路由</th>
      <th>操作区</th>
    </tr>
    </thead>
    <tbody>
    <ng-container *ngFor="let data of expandTable.data">
      <ng-container *ngFor="let item of mapOfExpandedData[data.menuCode]">
        <tr *ngIf="(item.parent && item.parent.expand) || !item.parent">
          <td
            [nzIndentSize]="item.level! * 20"
            [nzShowExpand]="item.children.length > 0"
            [(nzExpand)]="item.expand"
            (nzExpandChange)="collapse(mapOfExpandedData[data.menuCode], item, $event)"
          >
            {{ item.menuCode }}
          </td>
          <td>{{ item.menuName }}</td>
          <td><i nz-icon nzType="{{ item.icon }}" nzTheme="outline"></i></td>
          <td>{{ item.url }}</td>
          <td>
            <a nz-button nzType="link" (click)="openEdit(item)"><i nz-icon nzType="edit"></i>编辑</a>
            <a nz-button nzType="link" (click)="delete(item.id)"><i nz-icon nzType="delete"></i>删除</a>
          </td>
        </tr>
      </ng-container>
    </ng-container>
    </tbody>
  </nz-table>
</nz-card>
<menu-list-edit #editComponent (voted)="onSmt()"></menu-list-edit>
